<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
Binary serialization for .hie files.
-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Iface.Ext.Binary</span><span>
</span><span id="line-8"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFile"><span class="hs-identifier">readHieFile</span></a></span><span>
</span><span id="line-9"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFileWithVersion"><span class="hs-identifier">readHieFileWithVersion</span></a></span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieHeader"><span class="hs-identifier">HieHeader</span></a></span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#writeHieFile"><span class="hs-identifier">writeHieFile</span></a></span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier">HieName</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#toHieName"><span class="hs-identifier">toHieName</span></a></span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier">HieFileResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier">hieMagic</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#hieNameOcc"><span class="hs-identifier">hieNameOcc</span></a></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier">NameCacheUpdater</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Settings.Utils.html#"><span class="hs-identifier">GHC.Settings.Utils</span></a></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Settings.Utils.html#maybeRead"><span class="hs-identifier">maybeRead</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Settings.Config.html"><span class="hs-identifier">GHC.Settings.Config</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Version.html#cProjectVersion"><span class="hs-identifier">cProjectVersion</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html"><span class="hs-identifier">GHC.Utils.Binary</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Binary.html"><span class="hs-identifier">GHC.Iface.Binary</span></a></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Binary.html#getDictFastString"><span class="hs-identifier">getDictFastString</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html"><span class="hs-identifier">GHC.Data.FastMutInt</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier">FastString</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html"><span class="hs-identifier">GHC.Types.Name.Cache</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Utils.html"><span class="hs-identifier">GHC.Builtin.Utils</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html"><span class="hs-identifier">GHC.Iface.Env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier">NameCacheUpdater</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.html#"><span class="hs-identifier">Data.Array</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">A</span></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>            </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>  </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BSC</span></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>                  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#mapAccumR"><span class="hs-identifier">mapAccumR</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span>                  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier">Word8</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier">Word32</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>              </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier">replicateM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#createDirectoryIfMissing"><span class="hs-identifier">createDirectoryIfMissing</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>            </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier">takeDirectory</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html"><span class="hs-identifier">GHC.Iface.Ext.Types</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">data</span><span> </span><span id="HieSymbolTable"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieSymbolTable"><span class="hs-identifier hs-var">HieSymbolTable</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="HieSymbolTable"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieSymbolTable"><span class="hs-identifier hs-var">HieSymbolTable</span></a></span></span><span>
</span><span id="line-52"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="hie_symtab_next"><span class="annot"><span class="annottext">HieSymbolTable -&gt; FastMutInt
</span><a href="GHC.Iface.Ext.Binary.html#hie_symtab_next"><span class="hs-identifier hs-var hs-var">hie_symtab_next</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span>
</span><span id="line-53"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="hie_symtab_map"><span class="annot"><span class="annottext">HieSymbolTable -&gt; IORef (UniqFM Name (Int, HieName))
</span><a href="GHC.Iface.Ext.Binary.html#hie_symtab_map"><span class="hs-identifier hs-var hs-var">hie_symtab_map</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-keyword">data</span><span> </span><span id="HieDictionary"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieDictionary"><span class="hs-identifier hs-var">HieDictionary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="HieDictionary"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieDictionary"><span class="hs-identifier hs-var">HieDictionary</span></a></span></span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="hie_dict_next"><span class="annot"><span class="annottext">HieDictionary -&gt; FastMutInt
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_next"><span class="hs-identifier hs-var hs-var">hie_dict_next</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span> </span><span class="hs-comment">-- The next index to use</span><span>
</span><span id="line-58"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="hie_dict_map"><span class="annot"><span class="annottext">HieDictionary -&gt; IORef (UniqFM FastString (Int, FastString))
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_map"><span class="hs-identifier hs-var hs-var">hie_dict_map</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- indexed by FastString</span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#initBinMemSize"><span class="hs-identifier hs-type">initBinMemSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-62"></span><span id="initBinMemSize"><span class="annot"><span class="annottext">initBinMemSize :: Int
</span><a href="GHC.Iface.Ext.Binary.html#initBinMemSize"><span class="hs-identifier hs-var hs-var">initBinMemSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1024</span></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1024</span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- | The header for HIE files - Capital ASCII letters \&quot;HIE\&quot;.</span><span>
</span><span id="line-65"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-type">hieMagic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-66"></span><span id="hieMagic"><span class="annot"><span class="annottext">hieMagic :: [Word8]
</span><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-var hs-var">hieMagic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">72</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">73</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">69</span></span><span class="hs-special">]</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#hieMagicLen"><span class="hs-identifier hs-type">hieMagicLen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-69"></span><span id="hieMagicLen"><span class="annot"><span class="annottext">hieMagicLen :: Int
</span><a href="GHC.Iface.Ext.Binary.html#hieMagicLen"><span class="hs-identifier hs-var hs-var">hieMagicLen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-var">hieMagic</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#ghcVersion"><span class="hs-identifier hs-type">ghcVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-72"></span><span id="ghcVersion"><span class="annot"><span class="annottext">ghcVersion :: ByteString
</span><a href="GHC.Iface.Ext.Binary.html#ghcVersion"><span class="hs-identifier hs-var hs-var">ghcVersion</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BSC.pack</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="../../ghc-boot/src/GHC.Version.html#cProjectVersion"><span class="hs-identifier hs-var">cProjectVersion</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putBinLine"><span class="hs-identifier hs-type">putBinLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span id="putBinLine"><span class="annot"><span class="annottext">putBinLine :: BinHandle -&gt; ByteString -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putBinLine"><span class="hs-identifier hs-var hs-var">putBinLine</span></a></span></span><span> </span><span id="local-6989586621681182176"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182176"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span id="local-6989586621681182175"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182175"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-76"></span><span>  </span><span class="annot"><span class="annottext">(Word8 -&gt; IO ()) -&gt; [Word8] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182176"><span class="hs-identifier hs-var">bh</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Word8] -&gt; IO ()) -&gt; [Word8] -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Word8]
</span><a href="../../bytestring/src/Data.ByteString.html#unpack"><span class="hs-identifier hs-var">BS.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182175"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-77"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182176"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">10</span></span><span> </span><span class="hs-comment">-- newline char</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-comment">-- | Write a `HieFile` to the given `FilePath`, with a proper header and</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- symbol tables for `Name`s and `FastString`s</span><span>
</span><span id="line-81"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#writeHieFile"><span class="hs-identifier hs-type">writeHieFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieFile"><span class="hs-identifier hs-type">HieFile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span id="writeHieFile"><span class="annot"><span class="annottext">writeHieFile :: [Char] -&gt; HieFile -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#writeHieFile"><span class="hs-identifier hs-var hs-var">writeHieFile</span></a></span></span><span> </span><span id="local-6989586621681182170"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182170"><span class="hs-identifier hs-var">hie_file_path</span></a></span></span><span> </span><span id="local-6989586621681182169"><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182169"><span class="hs-identifier hs-var">hiefile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-83"></span><span>  </span><span id="local-6989586621681182168"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO BinHandle
</span><a href="GHC.Utils.Binary.html#openBinMem"><span class="hs-identifier hs-var">openBinMem</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Iface.Ext.Binary.html#initBinMemSize"><span class="hs-identifier hs-var">initBinMemSize</span></a></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-comment">-- Write the header: hieHeader followed by the</span><span>
</span><span id="line-86"></span><span>  </span><span class="hs-comment">-- hieVersion and the GHC version used to generate this file</span><span>
</span><span id="line-87"></span><span>  </span><span class="annot"><span class="annottext">(Word8 -&gt; IO ()) -&gt; [Word8] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-var">hieMagic</span></a></span><span>
</span><span id="line-88"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; ByteString -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putBinLine"><span class="hs-identifier hs-var">putBinLine</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ()) -&gt; ByteString -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BSC.pack</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; ByteString) -&gt; [Char] -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="GHC.Iface.Ext.Types.html#hieVersion"><span class="hs-identifier hs-var">hieVersion</span></a></span><span>
</span><span id="line-89"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; ByteString -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putBinLine"><span class="hs-identifier hs-var">putBinLine</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ()) -&gt; ByteString -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="GHC.Iface.Ext.Binary.html#ghcVersion"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span>  </span><span class="hs-comment">-- remember where the dictionary pointer will go</span><span>
</span><span id="line-92"></span><span>  </span><span id="local-6989586621681182164"><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182164"><span class="hs-identifier hs-var">dict_p_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin (Bin Any))
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-93"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin (Bin Any) -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182164"><span class="hs-identifier hs-var">dict_p_p</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>  </span><span class="hs-comment">-- remember where the symbol table pointer will go</span><span>
</span><span id="line-96"></span><span>  </span><span id="local-6989586621681182161"><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182161"><span class="hs-identifier hs-var">symtab_p_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin (Bin Any))
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-97"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin (Bin Any) -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182161"><span class="hs-identifier hs-var">symtab_p_p</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-comment">-- Make some initial state</span><span>
</span><span id="line-100"></span><span>  </span><span id="local-6989586621681182160"><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182160"><span class="hs-identifier hs-var">symtab_next</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO FastMutInt
</span><a href="GHC.Data.FastMutInt.html#newFastMutInt"><span class="hs-identifier hs-var">newFastMutInt</span></a></span><span>
</span><span id="line-101"></span><span>  </span><span class="annot"><span class="annottext">FastMutInt -&gt; Int -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-var">writeFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182160"><span class="hs-identifier hs-var">symtab_next</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-102"></span><span>  </span><span id="local-6989586621681182157"><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681182157"><span class="hs-identifier hs-var">symtab_map</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
-&gt; IO (IORef (UniqFM Name (Int, HieName)))
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
forall key elt. UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#emptyUFM"><span class="hs-identifier hs-var">emptyUFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182154"><span class="annot"><span class="annottext">hie_symtab :: HieSymbolTable
</span><a href="#local-6989586621681182154"><span class="hs-identifier hs-var hs-var">hie_symtab</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HieSymbolTable :: FastMutInt -&gt; IORef (UniqFM Name (Int, HieName)) -&gt; HieSymbolTable
</span><a href="GHC.Iface.Ext.Binary.html#HieSymbolTable"><span class="hs-identifier hs-type">HieSymbolTable</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-104"></span><span>                      </span><span class="annot"><span class="annottext">hie_symtab_next :: FastMutInt
</span><a href="GHC.Iface.Ext.Binary.html#hie_symtab_next"><span class="hs-identifier hs-var">hie_symtab_next</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182160"><span class="hs-identifier hs-var">symtab_next</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>                      </span><span class="annot"><span class="annottext">hie_symtab_map :: IORef (UniqFM Name (Int, HieName))
</span><a href="GHC.Iface.Ext.Binary.html#hie_symtab_map"><span class="hs-identifier hs-var">hie_symtab_map</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681182157"><span class="hs-identifier hs-var">symtab_map</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-106"></span><span>  </span><span id="local-6989586621681182153"><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182153"><span class="hs-identifier hs-var">dict_next_ref</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO FastMutInt
</span><a href="GHC.Data.FastMutInt.html#newFastMutInt"><span class="hs-identifier hs-var">newFastMutInt</span></a></span><span>
</span><span id="line-107"></span><span>  </span><span class="annot"><span class="annottext">FastMutInt -&gt; Int -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-var">writeFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182153"><span class="hs-identifier hs-var">dict_next_ref</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-108"></span><span>  </span><span id="local-6989586621681182152"><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182152"><span class="hs-identifier hs-var">dict_map_ref</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
-&gt; IO (IORef (UniqFM FastString (Int, FastString)))
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
forall key elt. UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#emptyUFM"><span class="hs-identifier hs-var">emptyUFM</span></a></span><span>
</span><span id="line-109"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182151"><span class="annot"><span class="annottext">hie_dict :: HieDictionary
</span><a href="#local-6989586621681182151"><span class="hs-identifier hs-var hs-var">hie_dict</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HieDictionary :: FastMutInt
-&gt; IORef (UniqFM FastString (Int, FastString)) -&gt; HieDictionary
</span><a href="GHC.Iface.Ext.Binary.html#HieDictionary"><span class="hs-identifier hs-type">HieDictionary</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-110"></span><span>                      </span><span class="annot"><span class="annottext">hie_dict_next :: FastMutInt
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_next"><span class="hs-identifier hs-var">hie_dict_next</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182153"><span class="hs-identifier hs-var">dict_next_ref</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-111"></span><span>                      </span><span class="annot"><span class="annottext">hie_dict_map :: IORef (UniqFM FastString (Int, FastString))
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_map"><span class="hs-identifier hs-var">hie_dict_map</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182152"><span class="hs-identifier hs-var">dict_map_ref</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span>  </span><span class="hs-comment">-- put the main thing</span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182150"><span class="annot"><span class="annottext">bh :: BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; UserData -&gt; BinHandle
</span><a href="GHC.Utils.Binary.html#setUserData"><span class="hs-identifier hs-var">setUserData</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182168"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">(UserData -&gt; BinHandle) -&gt; UserData -&gt; BinHandle
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BinHandle -&gt; Name -&gt; IO ())
-&gt; (BinHandle -&gt; Name -&gt; IO ())
-&gt; (BinHandle -&gt; FastString -&gt; IO ())
-&gt; UserData
</span><a href="GHC.Utils.Binary.html#newWriteState"><span class="hs-identifier hs-var">newWriteState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HieSymbolTable -&gt; BinHandle -&gt; Name -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putName"><span class="hs-identifier hs-var">putName</span></a></span><span> </span><span class="annot"><span class="annottext">HieSymbolTable
</span><a href="#local-6989586621681182154"><span class="hs-identifier hs-var">hie_symtab</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HieSymbolTable -&gt; BinHandle -&gt; Name -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putName"><span class="hs-identifier hs-var">putName</span></a></span><span> </span><span class="annot"><span class="annottext">HieSymbolTable
</span><a href="#local-6989586621681182154"><span class="hs-identifier hs-var">hie_symtab</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HieDictionary -&gt; BinHandle -&gt; FastString -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putFastString"><span class="hs-identifier hs-var">putFastString</span></a></span><span> </span><span class="annot"><span class="annottext">HieDictionary
</span><a href="#local-6989586621681182151"><span class="hs-identifier hs-var">hie_dict</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; HieFile -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182169"><span class="hs-identifier hs-var">hiefile</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-comment">-- write the symtab pointer at the front of the file</span><span>
</span><span id="line-120"></span><span>  </span><span id="local-6989586621681182145"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182145"><span class="hs-identifier hs-var">symtab_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-121"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin (Bin Any) -&gt; Bin Any -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; Bin a -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putAt"><span class="hs-identifier hs-var">putAt</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182161"><span class="hs-identifier hs-var">symtab_p_p</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182145"><span class="hs-identifier hs-var">symtab_p</span></a></span><span>
</span><span id="line-122"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182145"><span class="hs-identifier hs-var">symtab_p</span></a></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-comment">-- write the symbol table itself</span><span>
</span><span id="line-125"></span><span>  </span><span id="local-6989586621681182142"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182142"><span class="hs-identifier hs-var">symtab_next'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastMutInt -&gt; IO Int
</span><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-var">readFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182160"><span class="hs-identifier hs-var">symtab_next</span></a></span><span>
</span><span id="line-126"></span><span>  </span><span id="local-6989586621681182140"><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681182140"><span class="hs-identifier hs-var">symtab_map'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
-&gt; IO (UniqFM Name (Int, HieName))
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681182157"><span class="hs-identifier hs-var">symtab_map</span></a></span><span>
</span><span id="line-127"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Int -&gt; UniqFM Name (Int, HieName) -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putSymbolTable"><span class="hs-identifier hs-var">putSymbolTable</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182142"><span class="hs-identifier hs-var">symtab_next'</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681182140"><span class="hs-identifier hs-var">symtab_map'</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-comment">-- write the dictionary pointer at the front of the file</span><span>
</span><span id="line-130"></span><span>  </span><span id="local-6989586621681182137"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182137"><span class="hs-identifier hs-var">dict_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-131"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin (Bin Any) -&gt; Bin Any -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; Bin a -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putAt"><span class="hs-identifier hs-var">putAt</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Bin (Bin Any)
</span><a href="#local-6989586621681182164"><span class="hs-identifier hs-var">dict_p_p</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182137"><span class="hs-identifier hs-var">dict_p</span></a></span><span>
</span><span id="line-132"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182137"><span class="hs-identifier hs-var">dict_p</span></a></span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span>  </span><span class="hs-comment">-- write the dictionary itself</span><span>
</span><span id="line-135"></span><span>  </span><span id="local-6989586621681182136"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182136"><span class="hs-identifier hs-var">dict_next</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastMutInt -&gt; IO Int
</span><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-var">readFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182153"><span class="hs-identifier hs-var">dict_next_ref</span></a></span><span>
</span><span id="line-136"></span><span>  </span><span id="local-6989586621681182135"><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
</span><a href="#local-6989586621681182135"><span class="hs-identifier hs-var">dict_map</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
-&gt; IO (UniqFM FastString (Int, FastString))
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182152"><span class="hs-identifier hs-var">dict_map_ref</span></a></span><span>
</span><span id="line-137"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Int -&gt; UniqFM FastString (Int, FastString) -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putDictionary"><span class="hs-identifier hs-var">putDictionary</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182136"><span class="hs-identifier hs-var">dict_next</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
</span><a href="#local-6989586621681182135"><span class="hs-identifier hs-var">dict_map</span></a></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-comment">-- and send the result to the file</span><span>
</span><span id="line-140"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; [Char] -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#createDirectoryIfMissing"><span class="hs-identifier hs-var">createDirectoryIfMissing</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182170"><span class="hs-identifier hs-var">hie_file_path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; [Char] -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#writeBinMem"><span class="hs-identifier hs-var">writeBinMem</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182150"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182170"><span class="hs-identifier hs-var">hie_file_path</span></a></span><span>
</span><span id="line-142"></span><span>  </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-keyword">data</span><span> </span><span id="HieFileResult"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-var">HieFileResult</span></a></span></span><span>
</span><span id="line-145"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="HieFileResult"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-var">HieFileResult</span></a></span></span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="hie_file_result_version"><span class="annot"><span class="annottext">HieFileResult -&gt; Integer
</span><a href="GHC.Iface.Ext.Binary.html#hie_file_result_version"><span class="hs-identifier hs-var hs-var">hie_file_result_version</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-147"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="hie_file_result_ghc_version"><span class="annot"><span class="annottext">HieFileResult -&gt; ByteString
</span><a href="GHC.Iface.Ext.Binary.html#hie_file_result_ghc_version"><span class="hs-identifier hs-var hs-var">hie_file_result_ghc_version</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-148"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="hie_file_result"><span class="annot"><span class="annottext">HieFileResult -&gt; HieFile
</span><a href="GHC.Iface.Ext.Binary.html#hie_file_result"><span class="hs-identifier hs-var hs-var">hie_file_result</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieFile"><span class="hs-identifier hs-type">HieFile</span></a></span><span>
</span><span id="line-149"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-keyword">type</span><span> </span><span id="HieHeader"><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieHeader"><span class="hs-identifier hs-var">HieHeader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">-- | Read a `HieFile` from a `FilePath`. Can use</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- an existing `NameCache`. Allows you to specify</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- which versions of hieFile to attempt to read.</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- `Left` case returns the failing header versions.</span><span>
</span><span id="line-157"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFileWithVersion"><span class="hs-identifier hs-type">readHieFileWithVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieHeader"><span class="hs-identifier hs-type">HieHeader</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-type">NameCacheUpdater</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieHeader"><span class="hs-identifier hs-type">HieHeader</span></a></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-type">HieFileResult</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span id="readHieFileWithVersion"><span class="annot"><span class="annottext">readHieFileWithVersion :: (HieHeader -&gt; Bool)
-&gt; NameCacheUpdater
-&gt; [Char]
-&gt; IO (Either HieHeader HieFileResult)
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileWithVersion"><span class="hs-identifier hs-var hs-var">readHieFileWithVersion</span></a></span></span><span> </span><span id="local-6989586621681182128"><span class="annot"><span class="annottext">HieHeader -&gt; Bool
</span><a href="#local-6989586621681182128"><span class="hs-identifier hs-var">readVersion</span></a></span></span><span> </span><span id="local-6989586621681182127"><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182127"><span class="hs-identifier hs-var">ncu</span></a></span></span><span> </span><span id="local-6989586621681182126"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182126"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-159"></span><span>  </span><span id="local-6989586621681182125"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182125"><span class="hs-identifier hs-var">bh0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO BinHandle
</span><a href="GHC.Utils.Binary.html#readBinMem"><span class="hs-identifier hs-var">readBinMem</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182126"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681182123"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182123"><span class="hs-identifier hs-var">hieVersion</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681182122"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182122"><span class="hs-identifier hs-var">ghcVersion</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; BinHandle -&gt; IO HieHeader
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileHeader"><span class="hs-identifier hs-var">readHieFileHeader</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182126"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182125"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">HieHeader -&gt; Bool
</span><a href="#local-6989586621681182128"><span class="hs-identifier hs-var">readVersion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182123"><span class="hs-identifier hs-var">hieVersion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182122"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-165"></span><span>    </span><span id="local-6989586621681182120"><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182120"><span class="hs-identifier hs-var">hieFile</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; NameCacheUpdater -&gt; IO HieFile
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileContents"><span class="hs-identifier hs-var">readHieFileContents</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182125"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182127"><span class="hs-identifier hs-var">ncu</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span class="annot"><span class="annottext">Either HieHeader HieFileResult
-&gt; IO (Either HieHeader HieFileResult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either HieHeader HieFileResult
 -&gt; IO (Either HieHeader HieFileResult))
-&gt; Either HieHeader HieFileResult
-&gt; IO (Either HieHeader HieFileResult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HieFileResult -&gt; Either HieHeader HieFileResult
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; ByteString -&gt; HieFile -&gt; HieFileResult
</span><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-var">HieFileResult</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182123"><span class="hs-identifier hs-var">hieVersion</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182122"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span> </span><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182120"><span class="hs-identifier hs-var">hieFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Either HieHeader HieFileResult
-&gt; IO (Either HieHeader HieFileResult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either HieHeader HieFileResult
 -&gt; IO (Either HieHeader HieFileResult))
-&gt; Either HieHeader HieFileResult
-&gt; IO (Either HieHeader HieFileResult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HieHeader -&gt; Either HieHeader HieFileResult
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182123"><span class="hs-identifier hs-var">hieVersion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182122"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | Read a `HieFile` from a `FilePath`. Can use</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- an existing `NameCache`.</span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFile"><span class="hs-identifier hs-type">readHieFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-type">NameCacheUpdater</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-type">HieFileResult</span></a></span><span>
</span><span id="line-173"></span><span id="readHieFile"><span class="annot"><span class="annottext">readHieFile :: NameCacheUpdater -&gt; [Char] -&gt; IO HieFileResult
</span><a href="GHC.Iface.Ext.Binary.html#readHieFile"><span class="hs-identifier hs-var hs-var">readHieFile</span></a></span></span><span> </span><span id="local-6989586621681182118"><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182118"><span class="hs-identifier hs-var">ncu</span></a></span></span><span> </span><span id="local-6989586621681182117"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182117"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>  </span><span id="local-6989586621681182116"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182116"><span class="hs-identifier hs-var">bh0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO BinHandle
</span><a href="GHC.Utils.Binary.html#readBinMem"><span class="hs-identifier hs-var">readBinMem</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182117"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681182115"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182115"><span class="hs-identifier hs-var">readHieVersion</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681182114"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182114"><span class="hs-identifier hs-var">ghcVersion</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; BinHandle -&gt; IO HieHeader
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileHeader"><span class="hs-identifier hs-var">readHieFileHeader</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182117"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182116"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-comment">-- Check if the versions match</span><span>
</span><span id="line-180"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182115"><span class="hs-identifier hs-var">readHieVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="GHC.Iface.Ext.Types.html#hieVersion"><span class="hs-identifier hs-var">hieVersion</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-181"></span><span>    </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall a. [Char] -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO ()) -&gt; [Char] -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [Char]
</span><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier hs-var">unwords</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;readHieFile: hie file versions don't match for file:&quot;</span></span><span>
</span><span id="line-182"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182117"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-183"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Expected&quot;</span></span><span>
</span><span id="line-184"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="GHC.Iface.Ext.Types.html#hieVersion"><span class="hs-identifier hs-var">hieVersion</span></a></span><span>
</span><span id="line-185"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;but got&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182115"><span class="hs-identifier hs-var">readHieVersion</span></a></span><span>
</span><span id="line-186"></span><span>                    </span><span class="hs-special">]</span><span>
</span><span id="line-187"></span><span>  </span><span id="local-6989586621681182110"><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182110"><span class="hs-identifier hs-var">hieFile</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; NameCacheUpdater -&gt; IO HieFile
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileContents"><span class="hs-identifier hs-var">readHieFileContents</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182116"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182118"><span class="hs-identifier hs-var">ncu</span></a></span><span>
</span><span id="line-188"></span><span>  </span><span class="annot"><span class="annottext">HieFileResult -&gt; IO HieFileResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HieFileResult -&gt; IO HieFileResult)
-&gt; HieFileResult -&gt; IO HieFileResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; ByteString -&gt; HieFile -&gt; HieFileResult
</span><a href="GHC.Iface.Ext.Binary.html#HieFileResult"><span class="hs-identifier hs-var">HieFileResult</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="GHC.Iface.Ext.Types.html#hieVersion"><span class="hs-identifier hs-var">hieVersion</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182114"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span> </span><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182110"><span class="hs-identifier hs-var">hieFile</span></a></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readBinLine"><span class="hs-identifier hs-type">readBinLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-191"></span><span id="readBinLine"><span class="annot"><span class="annottext">readBinLine :: BinHandle -&gt; IO ByteString
</span><a href="GHC.Iface.Ext.Binary.html#readBinLine"><span class="hs-identifier hs-var hs-var">readBinLine</span></a></span></span><span> </span><span id="local-6989586621681182108"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182108"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#pack"><span class="hs-identifier hs-var">BS.pack</span></a></span><span> </span><span class="annot"><span class="annottext">([Word8] -&gt; ByteString)
-&gt; ([Word8] -&gt; [Word8]) -&gt; [Word8] -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; [Word8]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([Word8] -&gt; ByteString) -&gt; IO [Word8] -&gt; IO ByteString
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; IO [Word8]
</span><a href="#local-6989586621681182103"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-193"></span><span>    </span><span id="local-6989586621681182103"><span class="annot"><span class="annottext">loop :: [Word8] -&gt; IO [Word8]
</span><a href="#local-6989586621681182103"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621681182097"><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182097"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-194"></span><span>      </span><span id="local-6989586621681182096"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681182096"><span class="hs-identifier hs-var">char</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word8
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182108"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span>
</span><span id="line-195"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681182096"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">10</span></span><span> </span><span class="hs-comment">-- ASCII newline '\n'</span><span>
</span><span id="line-196"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; IO [Word8]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182097"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-197"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; IO [Word8]
</span><a href="#local-6989586621681182103"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681182096"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; [Word8] -&gt; [Word8]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182097"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFileHeader"><span class="hs-identifier hs-type">readHieFileHeader</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieHeader"><span class="hs-identifier hs-type">HieHeader</span></a></span><span>
</span><span id="line-200"></span><span id="readHieFileHeader"><span class="annot"><span class="annottext">readHieFileHeader :: [Char] -&gt; BinHandle -&gt; IO HieHeader
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileHeader"><span class="hs-identifier hs-var hs-var">readHieFileHeader</span></a></span></span><span> </span><span id="local-6989586621681182094"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182094"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span id="local-6989586621681182093"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182093"><span class="hs-identifier hs-var">bh0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-comment">-- Read the header</span><span>
</span><span id="line-202"></span><span>  </span><span id="local-6989586621681182092"><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182092"><span class="hs-identifier hs-var">magic</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO Word8 -&gt; IO [Word8]
forall (m :: * -&gt; *) a. Applicative m =&gt; Int -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Iface.Ext.Binary.html#hieMagicLen"><span class="hs-identifier hs-var">hieMagicLen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word8
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182093"><span class="hs-identifier hs-var">bh0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>  </span><span id="local-6989586621681182091"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182091"><span class="hs-identifier hs-var">version</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">BSC.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char]) -&gt; IO ByteString -&gt; IO [Char]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO ByteString
</span><a href="GHC.Iface.Ext.Binary.html#readBinLine"><span class="hs-identifier hs-var">readBinLine</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182093"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-204"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe Integer
forall a. Read a =&gt; [Char] -&gt; Maybe a
</span><a href="../../ghc-boot/src/GHC.Settings.Utils.html#maybeRead"><span class="hs-identifier hs-var">maybeRead</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182091"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-205"></span><span>    </span><span class="annot"><span class="annottext">Maybe Integer
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-206"></span><span>      </span><span class="annot"><span class="annottext">[Char] -&gt; IO HieHeader
forall a. [Char] -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO HieHeader) -&gt; [Char] -&gt; IO HieHeader
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [Char]
</span><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier hs-var">unwords</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;readHieFileHeader: hieVersion isn't an Integer:&quot;</span></span><span>
</span><span id="line-207"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182091"><span class="hs-identifier hs-var">version</span></a></span><span>
</span><span id="line-208"></span><span>                      </span><span class="hs-special">]</span><span>
</span><span id="line-209"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681182089"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182089"><span class="hs-identifier hs-var">readHieVersion</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-210"></span><span>      </span><span id="local-6989586621681182088"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182088"><span class="hs-identifier hs-var">ghcVersion</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO ByteString
</span><a href="GHC.Iface.Ext.Binary.html#readBinLine"><span class="hs-identifier hs-var">readBinLine</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182093"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>      </span><span class="hs-comment">-- Check if the header is valid</span><span>
</span><span id="line-213"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182092"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; [Word8] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-var">hieMagic</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-214"></span><span>        </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall a. [Char] -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO ()) -&gt; [Char] -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [Char]
</span><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier hs-var">unwords</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;readHieFileHeader: headers don't match for file:&quot;</span></span><span>
</span><span id="line-215"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621681182094"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-216"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Expected&quot;</span></span><span>
</span><span id="line-217"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="GHC.Iface.Ext.Binary.html#hieMagic"><span class="hs-identifier hs-var">hieMagic</span></a></span><span>
</span><span id="line-218"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;but got&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621681182092"><span class="hs-identifier hs-var">magic</span></a></span><span>
</span><span id="line-219"></span><span>                        </span><span class="hs-special">]</span><span>
</span><span id="line-220"></span><span>      </span><span class="annot"><span class="annottext">HieHeader -&gt; IO HieHeader
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681182089"><span class="hs-identifier hs-var">readHieVersion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681182088"><span class="hs-identifier hs-var">ghcVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#readHieFileContents"><span class="hs-identifier hs-type">readHieFileContents</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-type">NameCacheUpdater</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieFile"><span class="hs-identifier hs-type">HieFile</span></a></span><span>
</span><span id="line-223"></span><span id="readHieFileContents"><span class="annot"><span class="annottext">readHieFileContents :: BinHandle -&gt; NameCacheUpdater -&gt; IO HieFile
</span><a href="GHC.Iface.Ext.Binary.html#readHieFileContents"><span class="hs-identifier hs-var hs-var">readHieFileContents</span></a></span></span><span> </span><span id="local-6989586621681182087"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182087"><span class="hs-identifier hs-var">bh0</span></a></span></span><span> </span><span id="local-6989586621681182086"><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182086"><span class="hs-identifier hs-var">ncu</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span>  </span><span id="local-6989586621681182085"><span class="annot"><span class="annottext">Dictionary
</span><a href="#local-6989586621681182085"><span class="hs-identifier hs-var">dict</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Dictionary
</span><a href="#local-6989586621681182084"><span class="hs-identifier hs-var">get_dictionary</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182087"><span class="hs-identifier hs-var">bh0</span></a></span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-comment">-- read the symbol table so we are capable of reading the actual data</span><span>
</span><span id="line-228"></span><span>  </span><span id="local-6989586621681182083"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182083"><span class="hs-identifier hs-var">bh1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-229"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182080"><span class="annot"><span class="annottext">bh1 :: BinHandle
</span><a href="#local-6989586621681182080"><span class="hs-identifier hs-var hs-var">bh1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; UserData -&gt; BinHandle
</span><a href="GHC.Utils.Binary.html#setUserData"><span class="hs-identifier hs-var">setUserData</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182087"><span class="hs-identifier hs-var">bh0</span></a></span><span> </span><span class="annot"><span class="annottext">(UserData -&gt; BinHandle) -&gt; UserData -&gt; BinHandle
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BinHandle -&gt; IO Name) -&gt; (BinHandle -&gt; IO FastString) -&gt; UserData
</span><a href="GHC.Utils.Binary.html#newReadState"><span class="hs-identifier hs-var">newReadState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; BinHandle -&gt; IO Name
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;getSymtabName&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>                                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Dictionary -&gt; BinHandle -&gt; IO FastString
</span><a href="GHC.Iface.Binary.html#getDictFastString"><span class="hs-identifier hs-var">getDictFastString</span></a></span><span> </span><span class="annot"><span class="annottext">Dictionary
</span><a href="#local-6989586621681182085"><span class="hs-identifier hs-var">dict</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>      </span><span id="local-6989586621681182077"><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182077"><span class="hs-identifier hs-var">symtab</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO SymbolTable
</span><a href="#local-6989586621681182076"><span class="hs-identifier hs-var">get_symbol_table</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182080"><span class="hs-identifier hs-var">bh1</span></a></span><span>
</span><span id="line-232"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182075"><span class="annot"><span class="annottext">bh1' :: BinHandle
</span><a href="#local-6989586621681182075"><span class="hs-identifier hs-var hs-var">bh1'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; UserData -&gt; BinHandle
</span><a href="GHC.Utils.Binary.html#setUserData"><span class="hs-identifier hs-var">setUserData</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182080"><span class="hs-identifier hs-var">bh1</span></a></span><span>
</span><span id="line-233"></span><span>               </span><span class="annot"><span class="annottext">(UserData -&gt; BinHandle) -&gt; UserData -&gt; BinHandle
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BinHandle -&gt; IO Name) -&gt; (BinHandle -&gt; IO FastString) -&gt; UserData
</span><a href="GHC.Utils.Binary.html#newReadState"><span class="hs-identifier hs-var">newReadState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SymbolTable -&gt; BinHandle -&gt; IO Name
</span><a href="GHC.Iface.Ext.Binary.html#getSymTabName"><span class="hs-identifier hs-var">getSymTabName</span></a></span><span> </span><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182077"><span class="hs-identifier hs-var">symtab</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Dictionary -&gt; BinHandle -&gt; IO FastString
</span><a href="GHC.Iface.Binary.html#getDictFastString"><span class="hs-identifier hs-var">getDictFastString</span></a></span><span> </span><span class="annot"><span class="annottext">Dictionary
</span><a href="#local-6989586621681182085"><span class="hs-identifier hs-var">dict</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; IO BinHandle
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182075"><span class="hs-identifier hs-var">bh1'</span></a></span><span>
</span><span id="line-236"></span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-comment">-- load the actual data</span><span>
</span><span id="line-238"></span><span>  </span><span id="local-6989586621681182073"><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182073"><span class="hs-identifier hs-var">hiefile</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO HieFile
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182083"><span class="hs-identifier hs-var">bh1</span></a></span><span>
</span><span id="line-239"></span><span>  </span><span class="annot"><span class="annottext">HieFile -&gt; IO HieFile
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HieFile
</span><a href="#local-6989586621681182073"><span class="hs-identifier hs-var">hiefile</span></a></span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-241"></span><span>    </span><span id="local-6989586621681182084"><span class="annot"><span class="annottext">get_dictionary :: BinHandle -&gt; IO Dictionary
</span><a href="#local-6989586621681182084"><span class="hs-identifier hs-var hs-var">get_dictionary</span></a></span></span><span> </span><span id="local-6989586621681182065"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-242"></span><span>      </span><span id="local-6989586621681182064"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182064"><span class="hs-identifier hs-var">dict_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span><span>
</span><span id="line-243"></span><span>      </span><span id="local-6989586621681182063"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182063"><span class="hs-identifier hs-var">data_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span><span>
</span><span id="line-244"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182064"><span class="hs-identifier hs-var">dict_p</span></a></span><span>
</span><span id="line-245"></span><span>      </span><span id="local-6989586621681182062"><span class="annot"><span class="annottext">Dictionary
</span><a href="#local-6989586621681182062"><span class="hs-identifier hs-var">dict</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Dictionary
</span><a href="GHC.Utils.Binary.html#getDictionary"><span class="hs-identifier hs-var">getDictionary</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span><span>
</span><span id="line-246"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182065"><span class="hs-identifier hs-var">bin_handle</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182063"><span class="hs-identifier hs-var">data_p</span></a></span><span>
</span><span id="line-247"></span><span>      </span><span class="annot"><span class="annottext">Dictionary -&gt; IO Dictionary
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Dictionary
</span><a href="#local-6989586621681182062"><span class="hs-identifier hs-var">dict</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span>    </span><span id="local-6989586621681182076"><span class="annot"><span class="annottext">get_symbol_table :: BinHandle -&gt; IO SymbolTable
</span><a href="#local-6989586621681182076"><span class="hs-identifier hs-var hs-var">get_symbol_table</span></a></span></span><span> </span><span id="local-6989586621681182053"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-250"></span><span>      </span><span id="local-6989586621681182052"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182052"><span class="hs-identifier hs-var">symtab_p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span><span>
</span><span id="line-251"></span><span>      </span><span id="local-6989586621681182051"><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182051"><span class="hs-identifier hs-var">data_p'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Bin Any)
forall {k} (a :: k). BinHandle -&gt; IO (Bin a)
</span><a href="GHC.Utils.Binary.html#tellBin"><span class="hs-identifier hs-var">tellBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span><span>
</span><span id="line-252"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182052"><span class="hs-identifier hs-var">symtab_p</span></a></span><span>
</span><span id="line-253"></span><span>      </span><span id="local-6989586621681182050"><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182050"><span class="hs-identifier hs-var">symtab</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; NameCacheUpdater -&gt; IO SymbolTable
</span><a href="GHC.Iface.Ext.Binary.html#getSymbolTable"><span class="hs-identifier hs-var">getSymbolTable</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span><span> </span><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182086"><span class="hs-identifier hs-var">ncu</span></a></span><span>
</span><span id="line-254"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Bin Any -&gt; IO ()
forall {k} (a :: k). BinHandle -&gt; Bin a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#seekBin"><span class="hs-identifier hs-var">seekBin</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182053"><span class="hs-identifier hs-var">bh1</span></a></span><span> </span><span class="annot"><span class="annottext">Bin Any
</span><a href="#local-6989586621681182051"><span class="hs-identifier hs-var">data_p'</span></a></span><span>
</span><span id="line-255"></span><span>      </span><span class="annot"><span class="annottext">SymbolTable -&gt; IO SymbolTable
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182050"><span class="hs-identifier hs-var">symtab</span></a></span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putFastString"><span class="hs-identifier hs-type">putFastString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieDictionary"><span class="hs-identifier hs-type">HieDictionary</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span id="putFastString"><span class="annot"><span class="annottext">putFastString :: HieDictionary -&gt; BinHandle -&gt; FastString -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putFastString"><span class="hs-identifier hs-var hs-var">putFastString</span></a></span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieDictionary"><span class="hs-identifier hs-type">HieDictionary</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hie_dict_next :: HieDictionary -&gt; FastMutInt
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_next"><span class="hs-identifier hs-var">hie_dict_next</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681182048"><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182048"><span class="hs-identifier hs-var">j_r</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-259"></span><span>                              </span><span class="annot"><span class="annottext">hie_dict_map :: HieDictionary -&gt; IORef (UniqFM FastString (Int, FastString))
</span><a href="GHC.Iface.Ext.Binary.html#hie_dict_map"><span class="hs-identifier hs-var">hie_dict_map</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681182047"><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182047"><span class="hs-identifier hs-var">out_r</span></a></span></span><span class="hs-special">}</span><span>  </span><span id="local-6989586621681182046"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182046"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span id="local-6989586621681182045"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681182045"><span class="hs-identifier hs-var">f</span></a></span></span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-261"></span><span>    </span><span id="local-6989586621681182044"><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
</span><a href="#local-6989586621681182044"><span class="hs-identifier hs-var">out</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
-&gt; IO (UniqFM FastString (Int, FastString))
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182047"><span class="hs-identifier hs-var">out_r</span></a></span><span>
</span><span id="line-262"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681182041"><span class="annot"><span class="annottext">unique :: Unique
</span><a href="#local-6989586621681182041"><span class="hs-identifier hs-var hs-var">unique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681182045"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-263"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
-&gt; Unique -&gt; Maybe (Int, FastString)
forall key elt. UniqFM key elt -&gt; Unique -&gt; Maybe elt
</span><a href="GHC.Types.Unique.FM.html#lookupUFM_Directly"><span class="hs-identifier hs-var">lookupUFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
</span><a href="#local-6989586621681182044"><span class="hs-identifier hs-var">out</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681182041"><span class="hs-identifier hs-var">unique</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-264"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681182038"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182038"><span class="hs-identifier hs-var">j</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FastString
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182046"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182038"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Int, FastString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-266"></span><span>           </span><span id="local-6989586621681182037"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182037"><span class="hs-identifier hs-var">j</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastMutInt -&gt; IO Int
</span><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-var">readFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182048"><span class="hs-identifier hs-var">j_r</span></a></span><span>
</span><span id="line-267"></span><span>           </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182046"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182037"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>           </span><span class="annot"><span class="annottext">FastMutInt -&gt; Int -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-var">writeFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681182048"><span class="hs-identifier hs-var">j_r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182037"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span>           </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
-&gt; UniqFM FastString (Int, FastString) -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM FastString (Int, FastString))
</span><a href="#local-6989586621681182047"><span class="hs-identifier hs-var">out_r</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqFM FastString (Int, FastString) -&gt; IO ())
-&gt; UniqFM FastString (Int, FastString) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
-&gt; Unique
-&gt; (Int, FastString)
-&gt; UniqFM FastString (Int, FastString)
forall key elt. UniqFM key elt -&gt; Unique -&gt; elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addToUFM_Directly"><span class="hs-identifier hs-var">addToUFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM FastString (Int, FastString)
</span><a href="#local-6989586621681182044"><span class="hs-identifier hs-var">out</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681182041"><span class="hs-identifier hs-var">unique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182037"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681182045"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putSymbolTable"><span class="hs-identifier hs-type">putSymbolTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-272"></span><span id="putSymbolTable"><span class="annot"><span class="annottext">putSymbolTable :: BinHandle -&gt; Int -&gt; UniqFM Name (Int, HieName) -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putSymbolTable"><span class="hs-identifier hs-var hs-var">putSymbolTable</span></a></span></span><span> </span><span id="local-6989586621681182032"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182032"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span id="local-6989586621681182031"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182031"><span class="hs-identifier hs-var">next_off</span></a></span></span><span> </span><span id="local-6989586621681182030"><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681182030"><span class="hs-identifier hs-var">symtab</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-273"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Int -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182032"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182031"><span class="hs-identifier hs-var">next_off</span></a></span><span>
</span><span id="line-274"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182025"><span class="annot"><span class="annottext">names :: [HieName]
</span><a href="#local-6989586621681182025"><span class="hs-identifier hs-var hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array Int HieName -&gt; [HieName]
forall i e. Array i e -&gt; [e]
</span><a href="../../base/src/GHC.Arr.html#elems"><span class="hs-identifier hs-var">A.elems</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int, Int) -&gt; [(Int, HieName)] -&gt; Array Int HieName
forall i e. Ix i =&gt; (i, i) -&gt; [(i, e)] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#array"><span class="hs-identifier hs-var">A.array</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182031"><span class="hs-identifier hs-var">next_off</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName) -&gt; [(Int, HieName)]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681182030"><span class="hs-identifier hs-var">symtab</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>  </span><span class="annot"><span class="annottext">(HieName -&gt; IO ()) -&gt; [HieName] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinHandle -&gt; HieName -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putHieName"><span class="hs-identifier hs-var">putHieName</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182032"><span class="hs-identifier hs-var">bh</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[HieName]
</span><a href="#local-6989586621681182025"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#getSymbolTable"><span class="hs-identifier hs-type">getSymbolTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-type">NameCacheUpdater</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#SymbolTable"><span class="hs-identifier hs-type">SymbolTable</span></a></span><span>
</span><span id="line-278"></span><span id="getSymbolTable"><span class="annot"><span class="annottext">getSymbolTable :: BinHandle -&gt; NameCacheUpdater -&gt; IO SymbolTable
</span><a href="GHC.Iface.Ext.Binary.html#getSymbolTable"><span class="hs-identifier hs-var hs-var">getSymbolTable</span></a></span></span><span> </span><span id="local-6989586621681182020"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182020"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span id="local-6989586621681182019"><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182019"><span class="hs-identifier hs-var">ncu</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-279"></span><span>  </span><span id="local-6989586621681182018"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182018"><span class="hs-identifier hs-var">sz</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Int
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182020"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-280"></span><span>  </span><span id="local-6989586621681182017"><span class="annot"><span class="annottext">[HieName]
</span><a href="#local-6989586621681182017"><span class="hs-identifier hs-var">od_names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO HieName -&gt; IO [HieName]
forall (m :: * -&gt; *) a. Applicative m =&gt; Int -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182018"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinHandle -&gt; IO HieName
</span><a href="GHC.Iface.Ext.Binary.html#getHieName"><span class="hs-identifier hs-var">getHieName</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182020"><span class="hs-identifier hs-var">bh</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>  </span><span class="annot"><span class="annottext">NameCacheUpdater -&gt; forall c. (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updateNameCache"><span class="hs-identifier hs-var hs-var">updateNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">NameCacheUpdater
</span><a href="#local-6989586621681182019"><span class="hs-identifier hs-var">ncu</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, SymbolTable)) -&gt; IO SymbolTable)
-&gt; (NameCache -&gt; (NameCache, SymbolTable)) -&gt; IO SymbolTable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681182014"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681182014"><span class="hs-identifier hs-var">nc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-282"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681182009"><span class="annot"><span class="annottext">arr :: SymbolTable
</span><a href="#local-6989586621681182009"><span class="hs-identifier hs-var hs-var">arr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int, Int) -&gt; [Name] -&gt; SymbolTable
forall i e. Ix i =&gt; (i, i) -&gt; [e] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#listArray"><span class="hs-identifier hs-var">A.listArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681182018"><span class="hs-identifier hs-var">sz</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681182007"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-283"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681182004"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681182004"><span class="hs-identifier hs-var">nc'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681182007"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681182007"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NameCache -&gt; HieName -&gt; (NameCache, Name))
-&gt; NameCache -&gt; [HieName] -&gt; (NameCache, [Name])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumR"><span class="hs-identifier hs-var">mapAccumR</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache -&gt; HieName -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Ext.Binary.html#fromHieName"><span class="hs-identifier hs-var">fromHieName</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681182014"><span class="hs-identifier hs-var">nc</span></a></span><span> </span><span class="annot"><span class="annottext">[HieName]
</span><a href="#local-6989586621681182017"><span class="hs-identifier hs-var">od_names</span></a></span><span>
</span><span id="line-284"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681182004"><span class="hs-identifier hs-var">nc'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182009"><span class="hs-identifier hs-var">arr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#getSymTabName"><span class="hs-identifier hs-type">getSymTabName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#SymbolTable"><span class="hs-identifier hs-type">SymbolTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-287"></span><span id="getSymTabName"><span class="annot"><span class="annottext">getSymTabName :: SymbolTable -&gt; BinHandle -&gt; IO Name
</span><a href="GHC.Iface.Ext.Binary.html#getSymTabName"><span class="hs-identifier hs-var hs-var">getSymTabName</span></a></span></span><span> </span><span id="local-6989586621681182002"><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182002"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span id="local-6989586621681182001"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182001"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-288"></span><span>  </span><span id="local-6989586621681182000"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681182000"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word32
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681182001"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-289"></span><span>  </span><span class="annot"><span class="annottext">Name -&gt; IO Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; IO Name) -&gt; Name -&gt; IO Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SymbolTable
</span><a href="#local-6989586621681182002"><span class="hs-identifier hs-var">st</span></a></span><span> </span><span class="annot"><span class="annottext">SymbolTable -&gt; Int -&gt; Name
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">A.!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681182000"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putName"><span class="hs-identifier hs-type">putName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieSymbolTable"><span class="hs-identifier hs-type">HieSymbolTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span id="putName"><span class="annot"><span class="annottext">putName :: HieSymbolTable -&gt; BinHandle -&gt; Name -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putName"><span class="hs-identifier hs-var hs-var">putName</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#HieSymbolTable"><span class="hs-identifier hs-type">HieSymbolTable</span></a></span><span> </span><span id="local-6989586621681181998"><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681181998"><span class="hs-identifier hs-var">next</span></a></span></span><span> </span><span id="local-6989586621681181997"><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681181997"><span class="hs-identifier hs-var">ref</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681181996"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181996"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span id="local-6989586621681181995"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-293"></span><span>  </span><span id="local-6989586621681181994"><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681181994"><span class="hs-identifier hs-var">symmap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
-&gt; IO (UniqFM Name (Int, HieName))
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681181997"><span class="hs-identifier hs-var">ref</span></a></span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName) -&gt; Name -&gt; Maybe (Int, HieName)
forall key elt. Uniquable key =&gt; UniqFM key elt -&gt; key -&gt; Maybe elt
</span><a href="GHC.Types.Unique.FM.html#lookupUFM"><span class="hs-identifier hs-var">lookupUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681181994"><span class="hs-identifier hs-var">symmap</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-295"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681181992"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181992"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#ExternalName"><span class="hs-identifier hs-type">ExternalName</span></a></span><span> </span><span id="local-6989586621681181990"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181990"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681181989"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181989"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Bool
</span><a href="GHC.Types.SrcLoc.html#isGoodSrcSpan"><span class="hs-identifier hs-var">isGoodSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-297"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681181985"><span class="annot"><span class="annottext">hieName :: HieName
</span><a href="#local-6989586621681181985"><span class="hs-identifier hs-var hs-var">hieName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; SrcSpan -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#ExternalName"><span class="hs-identifier hs-var">ExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181990"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181989"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>      </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681181997"><span class="hs-identifier hs-var">ref</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqFM Name (Int, HieName) -&gt; IO ())
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
-&gt; Name -&gt; (Int, HieName) -&gt; UniqFM Name (Int, HieName)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; key -&gt; elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addToUFM"><span class="hs-identifier hs-var">addToUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681181994"><span class="hs-identifier hs-var">symmap</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181992"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HieName
</span><a href="#local-6989586621681181985"><span class="hs-identifier hs-var">hieName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181996"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181992"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681181983"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181983"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#LocalName"><span class="hs-identifier hs-type">LocalName</span></a></span><span> </span><span id="local-6989586621681181981"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181981"><span class="hs-identifier hs-var">_occ</span></a></span></span><span> </span><span id="local-6989586621681181980"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181980"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HieName -&gt; Bool
</span><a href="#local-6989586621681181979"><span class="hs-identifier hs-var">notLocal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#toHieName"><span class="hs-identifier hs-var">toHieName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181980"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-302"></span><span>      </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681181997"><span class="hs-identifier hs-var">ref</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqFM Name (Int, HieName) -&gt; IO ())
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
-&gt; Name -&gt; (Int, HieName) -&gt; UniqFM Name (Int, HieName)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; key -&gt; elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addToUFM"><span class="hs-identifier hs-var">addToUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681181994"><span class="hs-identifier hs-var">symmap</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181983"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#toHieName"><span class="hs-identifier hs-var">toHieName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>      </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181996"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181983"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681181977"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181977"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HieName
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181996"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181977"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>    </span><span class="annot"><span class="annottext">Maybe (Int, HieName)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-306"></span><span>        </span><span id="local-6989586621681181976"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181976"><span class="hs-identifier hs-var">off</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastMutInt -&gt; IO Int
</span><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-var">readFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681181998"><span class="hs-identifier hs-var">next</span></a></span><span>
</span><span id="line-307"></span><span>        </span><span class="annot"><span class="annottext">FastMutInt -&gt; Int -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-var">writeFastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">FastMutInt
</span><a href="#local-6989586621681181998"><span class="hs-identifier hs-var">next</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181976"><span class="hs-identifier hs-var">off</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>        </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (UniqFM Name (Int, HieName))
</span><a href="#local-6989586621681181997"><span class="hs-identifier hs-var">ref</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqFM Name (Int, HieName) -&gt; IO ())
-&gt; UniqFM Name (Int, HieName) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
-&gt; Name -&gt; (Int, HieName) -&gt; UniqFM Name (Int, HieName)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; key -&gt; elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addToUFM"><span class="hs-identifier hs-var">addToUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM Name (Int, HieName)
</span><a href="#local-6989586621681181994"><span class="hs-identifier hs-var">symmap</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181976"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#toHieName"><span class="hs-identifier hs-var">toHieName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181995"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>        </span><span class="annot"><span class="annottext">BinHandle -&gt; Word32 -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181996"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181976"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-312"></span><span>    </span><span class="annot"><a href="#local-6989586621681181979"><span class="hs-identifier hs-type">notLocal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621681181979"><span class="annot"><span class="annottext">notLocal :: HieName -&gt; Bool
</span><a href="#local-6989586621681181979"><span class="hs-identifier hs-var hs-var">notLocal</span></a></span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#LocalName"><span class="hs-identifier hs-type">LocalName</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-314"></span><span>    </span><span class="annot"><a href="#local-6989586621681181979"><span class="hs-identifier hs-var">notLocal</span></a></span><span> </span><span class="annot"><span class="annottext">HieName
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span class="hs-comment">-- ** Converting to and from `HieName`'s</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#fromHieName"><span class="hs-identifier hs-type">fromHieName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span id="fromHieName"><span class="annot"><span class="annottext">fromHieName :: NameCache -&gt; HieName -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Ext.Binary.html#fromHieName"><span class="hs-identifier hs-var hs-var">fromHieName</span></a></span></span><span> </span><span id="local-6989586621681181975"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181975"><span class="hs-identifier hs-var">nc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#ExternalName"><span class="hs-identifier hs-type">ExternalName</span></a></span><span> </span><span id="local-6989586621681181974"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181974"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681181973"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181973"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681181972"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181972"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-321"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681181971"><span class="annot"><span class="annottext">cache :: OrigNameCache
</span><a href="#local-6989586621681181971"><span class="hs-identifier hs-var hs-var">cache</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181975"><span class="hs-identifier hs-var">nc</span></a></span><span>
</span><span id="line-322"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Cache.html#lookupOrigNameCache"><span class="hs-identifier hs-var">lookupOrigNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681181971"><span class="hs-identifier hs-var">cache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181974"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181973"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-323"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681181968"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181968"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181975"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181968"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>         </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-325"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681181967"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181967"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681181966"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681181966"><span class="hs-identifier hs-var">us</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var hs-var">nsUniqs</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181975"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-326"></span><span>               </span><span id="local-6989586621681181964"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681181964"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181967"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181974"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181973"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181972"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-327"></span><span>               </span><span id="local-6989586621681181962"><span class="annot"><span class="annottext">new_cache :: OrigNameCache
</span><a href="#local-6989586621681181962"><span class="hs-identifier hs-var hs-var">new_cache</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Name -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier hs-var">extendNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681181971"><span class="hs-identifier hs-var">cache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181974"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181973"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181964"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-328"></span><span>           </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181975"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nsUniqs :: UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var">nsUniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681181966"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">nsNames :: OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var">nsNames</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681181962"><span class="hs-identifier hs-var">new_cache</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181964"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#fromHieName"><span class="hs-identifier hs-var">fromHieName</span></a></span><span> </span><span id="local-6989586621681181960"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181960"><span class="hs-identifier hs-var">nc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#LocalName"><span class="hs-identifier hs-type">LocalName</span></a></span><span> </span><span id="local-6989586621681181959"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181959"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681181958"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181958"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-330"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681181957"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181957"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681181956"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681181956"><span class="hs-identifier hs-var">us</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var hs-var">nsUniqs</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181960"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-331"></span><span>        </span><span id="local-6989586621681181955"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681181955"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181957"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181959"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181958"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-332"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181960"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nsUniqs :: UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var">nsUniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681181956"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181955"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#fromHieName"><span class="hs-identifier hs-var">fromHieName</span></a></span><span> </span><span id="local-6989586621681181953"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181953"><span class="hs-identifier hs-var">nc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#KnownKeyName"><span class="hs-identifier hs-type">KnownKeyName</span></a></span><span> </span><span id="local-6989586621681181951"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181951"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Maybe Name
</span><a href="GHC.Builtin.Utils.html#lookupKnownKeyName"><span class="hs-identifier hs-var">lookupKnownKeyName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181951"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-334"></span><span>    </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; SDoc -&gt; (NameCache, Name)
forall a. HasCallStack =&gt; [Char] -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;fromHieName:unknown known-key unique&quot;</span></span><span>
</span><span id="line-335"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char, Int) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; (Char, Int)
</span><a href="GHC.Types.Unique.html#unpkUnique"><span class="hs-identifier hs-var">unpkUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181951"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681181946"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181946"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681181953"><span class="hs-identifier hs-var">nc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681181946"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="hs-comment">-- ** Reading and writing `HieName`'s</span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putHieName"><span class="hs-identifier hs-type">putHieName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span id="putHieName"><span class="annot"><span class="annottext">putHieName :: BinHandle -&gt; HieName -&gt; IO ()
</span><a href="GHC.Iface.Ext.Binary.html#putHieName"><span class="hs-identifier hs-var hs-var">putHieName</span></a></span></span><span> </span><span id="local-6989586621681181945"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181945"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#ExternalName"><span class="hs-identifier hs-type">ExternalName</span></a></span><span> </span><span id="local-6989586621681181944"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181944"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681181943"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181943"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681181942"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181942"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-342"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181945"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span>
</span><span id="line-343"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; (Module, OccName, SrcSpan) -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181945"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181944"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181943"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181942"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putHieName"><span class="hs-identifier hs-var">putHieName</span></a></span><span> </span><span id="local-6989586621681181941"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181941"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#LocalName"><span class="hs-identifier hs-type">LocalName</span></a></span><span> </span><span id="local-6989586621681181940"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181940"><span class="hs-identifier hs-var">occName</span></a></span></span><span> </span><span id="local-6989586621681181939"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181939"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-345"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181941"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span>
</span><span id="line-346"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; (OccName, SrcSpan) -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181941"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181940"><span class="hs-identifier hs-var">occName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181939"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#putHieName"><span class="hs-identifier hs-var">putHieName</span></a></span><span> </span><span id="local-6989586621681181938"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181938"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Ext.Types.html#KnownKeyName"><span class="hs-identifier hs-type">KnownKeyName</span></a></span><span> </span><span id="local-6989586621681181937"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181937"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-348"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181938"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">2</span></span><span>
</span><span id="line-349"></span><span>  </span><span class="annot"><span class="annottext">BinHandle -&gt; (Char, Int) -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181938"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">((Char, Int) -&gt; IO ()) -&gt; (Char, Int) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; (Char, Int)
</span><a href="GHC.Types.Unique.html#unpkUnique"><span class="hs-identifier hs-var">unpkUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681181937"><span class="hs-identifier hs-var">uniq</span></a></span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span class="annot"><a href="GHC.Iface.Ext.Binary.html#getHieName"><span class="hs-identifier hs-type">getHieName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html#BinHandle"><span class="hs-identifier hs-type">BinHandle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Iface.Ext.Types.html#HieName"><span class="hs-identifier hs-type">HieName</span></a></span><span>
</span><span id="line-352"></span><span id="getHieName"><span class="annot"><span class="annottext">getHieName :: BinHandle -&gt; IO HieName
</span><a href="GHC.Iface.Ext.Binary.html#getHieName"><span class="hs-identifier hs-var hs-var">getHieName</span></a></span></span><span> </span><span id="local-6989586621681181936"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181936"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-353"></span><span>  </span><span id="local-6989586621681181935"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681181935"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word8
</span><a href="GHC.Utils.Binary.html#getByte"><span class="hs-identifier hs-var">getByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181936"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-354"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681181935"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-355"></span><span>    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-356"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681181933"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181933"><span class="hs-identifier hs-var">modu</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681181932"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181932"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681181931"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181931"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Module, OccName, SrcSpan)
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181936"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-357"></span><span>      </span><span class="annot"><span class="annottext">HieName -&gt; IO HieName
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HieName -&gt; IO HieName) -&gt; HieName -&gt; IO HieName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; SrcSpan -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#ExternalName"><span class="hs-identifier hs-var">ExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681181933"><span class="hs-identifier hs-var">modu</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181932"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181931"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-358"></span><span>    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-359"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681181930"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181930"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681181929"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181929"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (OccName, SrcSpan)
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181936"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-360"></span><span>      </span><span class="annot"><span class="annottext">HieName -&gt; IO HieName
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HieName -&gt; IO HieName) -&gt; HieName -&gt; IO HieName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SrcSpan -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#LocalName"><span class="hs-identifier hs-var">LocalName</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681181930"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681181929"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-361"></span><span>    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">2</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-362"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681181928"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681181928"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681181927"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181927"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO (Char, Int)
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621681181936"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-363"></span><span>      </span><span class="annot"><span class="annottext">HieName -&gt; IO HieName
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HieName -&gt; IO HieName) -&gt; HieName -&gt; IO HieName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; HieName
</span><a href="GHC.Iface.Ext.Types.html#KnownKeyName"><span class="hs-identifier hs-var">KnownKeyName</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; HieName) -&gt; Unique -&gt; HieName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int -&gt; Unique
</span><a href="GHC.Types.Unique.html#mkUnique"><span class="hs-identifier hs-var">mkUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681181928"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681181927"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-364"></span><span>    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO HieName
forall a. [Char] -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;GHC.Iface.Ext.Binary.getHieName: invalid tag&quot;</span></span><span>
</span><span id="line-365"></span></pre></body></html>